

def pipei(nums):
    list1 = []

    for i in nums:
        if not list1:
            list1.append(i)
        elif list1[-1] == '(' and i == ')':
            list1.pop()
        elif list1[-1] == '[' and i == ']':
            list1.pop()
        elif list1[-1] == '{' and i == '}':
            list1.pop()
        else:
            list1.append(i)
    if not list1:
        return True
    else:
        return False

# print(pipei("()({})"))
print(pipei("({[[})"))